package leetcode.N1_N100;

/**
 * @author 歪大哥😁
 * @date 2020-03-27.
 */
public class N9 {



    static boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        char[] xStr = (x + "").toCharArray();
        int length = xStr.length;
        for (int i = 0; i < (length / 2); i++) {
            char left = xStr[i];
            char right = xStr[length - i - 1];
            if (left != right) {
                return false;
            }
        }
        return true;
    }


}
